<html>
    <body>

        <div>
            <h1>Quick Introduction to Chiron</h1>
            <p>The purpose of this introduction to Chiron's <tt>base.js</tt> module is
            to quickly illuminate the simplicity, brevity, and power of some selected
            one-liners without a great deal of explanation.</p>
            <p>You can press <tt>enter</tt> at any time to see another example.  Any other
            command you type will be interpreted as JavaScript in a Chiron module environment.</p>
        </div>

        <div>
            <p>Initially, you'll need to include <tt>base.js</tt> in your module, or
            on the Chiron interactive JavaScript interpreter to use its functions.</p>
            <p><code command>include('base.js')</code></p>
        </div>

        <div>
            <h2>Gauss' Sum</h2>
            <p><code command>count(10).args(add);</code></p>
        </div>

        <div>
            <h2>Factorial</h2>
            <p><code command>count(5).args(mul);</code></p>
        </div>

        <div>
            <h2>The Fibonacci sequence</h2>
            <p><code command>seq(1, 1, add).to(range(10));</code></p>
        </div>

        <div>
            <h2>Approximating the Golden Mean (Phi)</h2>
            <p><code command>seq(1, 1, add).to(edgesIter).eachArgsIter(function (m, n) {return m / n}).to(range(12)).forEach(log)</code></p>
        </div>

        <div>
            <h2>Variation on a sequence</h2>
            <p><code command>seq(1, 2, 3, mul).to(range(10))</code></p>
        </div>

        <div>
            <h2>A simple sequence</h2>
            <p><code command>seq(1, function (n) {return n + 1}).to(range(10))</code></p>
        </div>

        <div>
            <h2>Types and their representations</h2>
            <p><code command>forEach([1, "a", [1, 2, 3], {'a': 10, 'b': 20}, list(), dict(), set(), range(), count(), iter()], function (thing) {log(getTypeName(thing) + ' ' + repr(thing))})</code></p>
        </div>

        <div>
            <h2>Extensive Iterations</h2>
            <p><code command>count(10).to(tee).transpose()</code></p>
        </div>

        <div>
            <h2>Comprehensive type conversion</h2>
            <p><code command>zip(count(), ["a", "b", "c"]).dict().getItem(2)</code></p>
        </div>

        <div>
            <h2>Real hash-table Dictionaries</h2>
            <p><code command>dict([['1', 'A'], [1, 'B'], ['__proto__', 'C']])</code></p>
            <p><code command>dict([['1', 'A'], [1, 'B'], ['__proto__', 'C']]).getItem('__proto__')</code></p>
            <p><code command>dict({'1': 'A', '2': 'B'})</code></p>
        </div>

        <div>
            <h2>Real hash-table Sets</h2>
            <p><code command>set(repeat(1, 10))</code></p>
            <p><code command>set(repeat({'a': 10}, 10))</code></p>
        </div>

        <div>
            <h2>Type mixing</h2>
            <p>Chiron supports type mixing by way of Python's method resolution
            order.</p>
            <p><code command>type([Dict, Iterable, Base], pass).getMro()</code></p>
        </div>

        <div>
            <h2>Conclusion</h2>
            <p>Chiron's base functions provide a wealth of opportunities for simplicity, power, and brevity,
            combining memes from various functional and imperative languages.</p>
            <p>Continue if you would like to see a gammut of more trivial examples.</p>
        </div>

        </div>

        <div>
            <p><code command>range(10)</code></p>
        </div>

        <div>
            <p><code command>range(10).list()</code></p>
        </div>

        <div>
            <p><code command>count(10)</code></p>
        </div>

        <div>
            <p><code command>count(10).list()</code></p>
        </div>

        <div>
            <p><code command>count(10).reversed()</code></p>
        </div>

        <div>
            <p><code command>count(10).reversed().sorted()</code></p>
        </div>

        <div>
            <p><code command>range(5, 10)</code></p>
        </div>

        <div>
            <p><code command>count(1, 20).each(string).sorted()</code></p>
        </div>

        <div>
            <p><code command>count(10).forEach(log)</code></p>
        </div>

        <div>
            <p><code command>count(10).join(', ')</code></p>
        </div>

        <div>
            <p><code command>list(['a', 'b', 'c']).to(range(1, 2))</code></p>
        </div>

        <div>
            <p><code command>range(10).to(list);</code></p>
        </div>

        <div>
            <p><code command>list(range(10));</code></p>
        </div>

        <div>
            <p><code command>pass(1)</code></p>
        </div>

        <div>
            <p><code command>seq(1, pass).to(range(10))</code></p>
        </div>

        <div>
            <p><code command>zip(range(10), count(10))</code></p>
        </div>

        <div>
            <p><code command>zip(count(10), range(10)).transpose()</code></p>
        </div>

        <div>
            <p><code command>count(10).to(edges)</code></p>
        </div>

        <div>
            <p><code command>count(10).to(edges).eachArgs(lt)</code></p>
        </div>

        <div>
            <p><code command>count(10).to(edges).eachArgs(lt).all()</code></p>
        </div>

        <div>
            <p><code command>sum(count(10))</code></p>
        </div>

        <div>
            <p><code command>count(10).iter().next()</code></p>
        </div>

        <div>
            <p><code command>count(10).to(tee)</code></p>
        </div>

        <div>
            <p><code command>count(10).to(tee).each(array)</code></p>
        </div>

        <div>
            <p><code command>count(10).to(tee).transpose()</code></p>
        </div>

        <div>
            <p>Type sensitive dictionaires.</p>
            <p><code command>dict([[1, 'a'], ['1', 'b']]).getItem('1');</code></p>
            <p><code command>dict([[1, 'a'], ['1', 'b']]).getItem(1);</code></p>
        </div>

        <div>
            <p><code command>set([1, 1, 1, "1", iter(), iter()])</code></p>
        </div>

        <div>
            <p><code command>list(['a', 'b', 'c']).dict()</code></p>
        </div>

        <div>
            <p><code command>seq(1, 1, add).to(edgesIter)</code></p>
        </div>

        <div>
            <p><code command>Iter(function () {throw stopIteration}).list()</code></p>
        </div>

        <div>
            <p><code command>var n = 0; Iter(function () {if (n != 10) return n++; throw stopIteration}).list()</code></p>
        </div>

        <div>
            <h2>The End</h2>
            <p>Stay tuned for more comprehensive documentation.</p>
        </div>

    </body>
</html>
